<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>  
<%@ taglib uri="/struts-dojo-tags" prefix="sx" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>  
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<sx:head />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>首頁</title>
	<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" />
	<style type="text/css">
		body{font:12px/18px Tahoma; }
	</style>
</head>
<body>
修改門市資料
<s:form id="form1" name="form1" action="action1!update">
	<input type="hidden" id="SID" name="SID" value="${store.SID }"/>
	<input type="hidden" id="PID" name="PID" value="${store.manager.PID }"/>
	<input type="hidden" id="SLaunch" name="SLaunch" value="${store.SLAUNCH }"/>
	<table border="1">
		<tr>
			<td>
				店名
			</td>
			<td>
				<input type="text" id="SName" name="SName" value="${store.SNAME }"/>
			</td>
		</tr>
		<tr>
			<td>
				門市地址
			</td>
			<td>
				<input type="text" id="SAddress" name="SAddress" value="${store.SADDRESS }"/>
			</td>
		</tr>
		<tr>
			<td>
				門市電話
			</td>
			<td>
				<input type="text" id="STel" name="STel" value="${store.STEL }"/>
			</td>
		</tr>
		<tr>
			<td>
				店長姓名
			</td>
			<td>
				<input type="text" id="PName" name="PName" value="${store.manager.PNAME}"/>
			</td>
		</tr>
		<tr>
			<td>
				店長住址
			</td>
			<td>
				<input type="text" id="PAddress" name="PAddress" value="${store.manager.PADDRESS }"/>
			</td>
		</tr>
		<tr>
			<td>
				店長電話
			</td>
			<td>
				<input type="text" id="PTel" name="PTel" value="${store.manager.PTEL }"/>
			</td>
		</tr>
		<tr>
			<td>
				店長到職日
			</td>
			<td>
				<sx:datetimepicker name="PDate" value="store.manager.PDATE" id="PDate" type="date" displayFormat="yyyy-MM-dd"></sx:datetimepicker>
			</td>
		</tr>
	</table>
	<input type="submit" value="送出" onclick="return validate()"/>
</s:form>

</body>
</html>
<script>
	function validate(){
		if(document.getElementById("SName").value == ""){
			alert("店-名稱不得為空");
		}else if(document.getElementById("SAddress").value == ""){
			alert("店-地址不得為空");
		}else if(document.getElementById("STel").value == ""){
			alert("店-電話不得為空");
		}else if(document.getElementById("PName").value == ""){
			alert("店-店長姓名不得為空");
		}else if(document.getElementById("PAddress").value == ""){
			alert("店-店長住址不得為空");
		}else if(document.getElementById("PTel").value == ""){
			alert("店-店長電話不得為空");
		}else if(document.getElementById("PDate").value == ""){
			alert("店-店長到職日不得為空");
		}else{
			return true;
		}
		return false;
	}
</script>


